﻿
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- saved from url=(0014)about:internet -->
<html>
    <head>
        <meta content="Innovasys Document! X (http://www.innovasys.com)" name=GENERATOR>
        <!--DXMETADATA start type="MetaCharset" --><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"><!--DXMETADATA end-->
        <!--DXMETADATA start type="PageItemTitle" format="<title>MergeItems Method</title>" --><title>MergeItems Method</title><!--DXMETADATA end-->
        <link href="stylesheets/axstylesheet.css" type=text/css rel=stylesheet>
        <script src="script/ax.js" type=text/javascript>
    </script>

    


<style>
html,div { margin: 0; padding: 0;}

body {
	padding: 0px;
	margin: 0px;
	overflow: auto;
	height: 100%;
}

#winchm_template_button{
	float: right;
	width: 93px;
	top: 7px;
	position: relative;
	text-align: right;
	right: 5px;
	height: auto;
}

#winchm_template_top{
	padding: 0px;
	margin: 0px;
	border-bottom: 1px solid #9B9B9B;
	background-color: #B1CEFE;
}

#winchm_template_navigation{
	margin: 0px;
	padding-top: 7px;
	padding-left: 7px;
	padding-bottom: 3px;
	padding-right: 0px;
	font-size: 8.5pt;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: normal;
	color: #585858;
}

#winchm_template_title{
	margin: 0px;
	padding-top: 4px;
	padding-left: 7px;
	padding-bottom: 7px;
	padding-right: 0px;
	font-size: 18px; 
	font-family: Verdana, Geneva, sans-serif;
	color: #363636;
}

#winchm_template_content{
	margin-top: 20px;
	margin-left: 15px;
	margin-bottom: 20px;
	margin-right: 15px;
	width: auto  !important;
	width: 100%;
}

#winchm_template_footer{
	border-width: 1px;
	border-color: #B1CEFE;
	border-top-style: solid;
	margin-top: 15px;
	margin-left: 15px;
	margin-bottom: 20px;
	margin-right: 15px;
	padding-top: 7px;
	padding-left: 0px;
	padding-bottom: 0px;
	padding-right: 0px;
	font-family: arial, helvetica, sans-serif;
	font-size: 8.5pt;
	color: #696969;
	width: auto;
	text-align: left;
}


#winchm_template_container{
	margin: 0px;
	padding: 0px;
	position: static;
	padding-bottom: 3px;
	overflow: auto;
	background-color: #FFFFFF;
}


@media print
{
#winchm_template_container{
	position: static;	
	margin: 0px;
	padding: 5px;
	
	width: auto;
	height: auto;
	overflow: auto;
}
#winchm_template_button{
visibility:hidden;
}
}

#winchm_template_navigation A:link	{text-decoration: none; color:#004080}
#winchm_template_navigation A:visited  {text-decoration: none; color: #004080}
#winchm_template_navigation A:active {text-decoration: none; color: #004080 }
#winchm_template_navigation A:hover {text-decoration: none;color: #0080FF}

A:link	{text-decoration: underline; color:#0033CC}
A:visited  {text-decoration: underline; color: #0033CC}
A:active {text-decoration: underline; color: #0033CC }
A:hover {text-decoration: underline;color: #FF0000;}
</style>
<script type="text/javascript">
function isMobile(){
Agent = window.navigator.userAgent;
if (Agent.indexOf("iPhone")>=1 || Agent.indexOf("iPad")>=1 || Agent.indexOf("iPod")>=1 || Agent.indexOf("Android")>=1){
return true;
}else{
return false;	
}

}
function d_onresize(){
if (window.navigator.userAgent.indexOf("MSIE")>=1){
document.getElementById('winchm_template_container').style.pixelWidth = document.body.offsetWidth - 3;
document.getElementById('winchm_template_container').style.pixelHeight = document.body.offsetHeight - document.getElementById('winchm_template_top').offsetHeight - 4;
}
document.getElementById('winchm_template_container').style.top = document.getElementById('winchm_template_top').offsetHeight + 'px';
}

function d_onbeforeprint(){
document.getElementById('winchm_template_container').style.width = 'auto';
document.getElementById('winchm_template_container').style.height = 'auto';
}

function d_onafterprint(){
d_onresize();
}

if(!isMobile()){

window.onload = d_onresize;
window.onresize = d_onresize;
window.onbeforeprint = d_onbeforeprint;
window.onafterprint = d_onafterprint;

document.write("<style>\n");
document.write("body {overflow: hidden;}\n");
document.write("#winchm_template_container {position: absolute;overflow: auto;top : 0px;right: 0px;bottom: 0px;left: 0px;}\n");
document.write("</style>\n");
}

</script>
</head>
    <body><script language="JavaScript" type="text/JavaScript">
function syn(){
if(parent.nav.tree){
 if(parent.nav.tree.loaded){
  parent.nav.tree.selectNode(14785);
 }else{
  setTimeout("syn()",500);
}
  }else{
  setTimeout("syn()",500);
  }}
if(parent!=self){
  setTimeout("syn()",100);
}else{
  parent.location.href = "../index.htm?page=XtremeReportControl~ReportRecords~MergeItems.html";
}
originalOnload = window.onload;
if(originalOnload==null){
window.onload = function(){parent.contentLoaded = true;};
}else{
window.onload = function(){originalOnload();parent.contentLoaded = true;};
}
</script> 


<div id="winchm_template_top">
	<div id="winchm_template_button"><A href="XtremeReportControl~TrackControl~LoadSettings.html" title="Previous topic"><img id="winchm_template_prev" alt="Previous topic" src="template2/btn_prev_n.gif" border="0"></a><A href="XtremeReportControl~ReportColumn~Move.html" title="Next topic"><img id="winchm_template_next" alt="Next topic" src="template2/btn_next_n.gif" border="0"></a></div>
	<div id="winchm_template_navigation">Help &gt; 
<A href="welcome_screen.htm">Codejock ActiveX Controls v15.3</A> &gt; <A href="XtremeReportControl_P.html">Xtreme Report Control</A> &gt; Methods &gt; </div>
	<div id="winchm_template_title">MergeItems Method</div>
</div>
<div id="winchm_template_container">
	<div id="winchm_template_content"><div class=popupbubble id=dxseealsomenu><p id=dxseealsocontent><a href="#Bookmark14113">ReportRecords Collection</a>
</p><!--DXMETADATA end --> 
        </div>
        <!--DXMETADATA start type="FilteredItemList" scrap="PARAMETERS_BUBBLES" namespace="parameter" source="Item" -->
<div id="RecordFrom_box" class="popupbubble">
<DL><DT class="popupbubble"><I>RecordFrom</I></DT>
<DD class="popupbubble">Index of the record to start the merge.&nbsp; Will be the same as <STRONG>RecordTo</STRONG> if merging cells horizontally.</DD></DL>
</div>
<div id="RecordTo_box" class="popupbubble">
<DL><DT class="popupbubble"><I>RecordTo</I></DT>
<DD class="popupbubble">Index of the record to&nbsp;end the merge. Will be the same as <STRONG>RecordFrom</STRONG> if merging cells horizontally.</DD></DL>
</div>
<div id="ColumnFrom_box" class="popupbubble">
<DL><DT class="popupbubble"><I>ColumnFrom</I></DT>
<DD class="popupbubble">Index of the&nbsp;column to start the merge.&nbsp; Will be the same as <STRONG>ColumnTo</STRONG> if merging cells vertically.</DD></DL>
</div>
<div id="ColumnTo_box" class="popupbubble">
<DL><DT class="popupbubble"><I>ColumnTo</I></DT>
<DD class="popupbubble">Index of the&nbsp;column to&nbsp;end the merge. Will be the same as <STRONG>ColumnFrom</STRONG> if merging cells vertically.</DD></DL>
</div>
<!--DXMETADATA end --> 
        <div id=pagetop>
            <div id=projectnamebanner>
                <table class=projectnametable cellspacing=0>
                    <tbody>
                        <tr>
                            <!--DXMETADATA start type="Literal" condition="childitems:itemtype=seealso" value="<td class='button'><a href='' id='seealsobutton' onclick='showSeeAlsoBox()'><img alt='See Also' border='0' src='axImages/seealso.gif' width=14 height=14></a></td>" --><td class='button'><a href='' id='seealsobutton' onclick='showSeeAlsoBox()'><img alt='See Also' border='0' src='axImages/seealso.gif' width=14 height=14></a></td><!--DXMETADATA end -->
                            <td>
                                <!--DXMETADATA start type="Phrase" Name="Product_Header" -->Xtreme Report Control ActiveX Control v15.3<!--DXMETADATA end --> 
                            </td>
                            <td align=right>
                                <!--DXMETADATA start type="Variable" name="FeedbackLink" format="" --><!--DXMETADATA end -->
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div id=pagetitlebanner>
                <h1 class=dxh1>
                <!--DXMETADATA start type="PageItemTitle" -->MergeItems Method<!--DXMETADATA end --></h1>
            </div>
        </div>
        <div id=pagebody valign="bottom">
            <!--DXMETADATA start type="IsNew" format="<script>document.all.pagebody.className = 'newTopic'</script>" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="Description" source="Item" format="<h4 class=dxh4>$$Description$$</h4><p>%%description%%</p>" --><h4 class=dxh4>Description</h4><p>Merges 2 or more items in the report.</p><!--DXMETADATA end --> 
            <!--DXMETADATA start type="Syntax" lang="VB" format="<div Class=LanguageSpecific Name=Syntax_VB><h4 class=dxh4>$$Syntax$$</h4><p>%%Syntax%%</p></div>" --><div Class=LanguageSpecific Name=Syntax_VB><h4 class=dxh4>Syntax</h4><p><PRE CLASS="syntax" LANG="VB"><strong>Public Sub MergeItems</strong>( _
&nbsp;&nbsp;&nbsp;<strong>ByVal </strong><i><a class="parameter" id="RecordFrom" href="#" onclick="javascript:showParamBox();">RecordFrom</a></i></strong> <strong>As</strong> <b>Long</b>, _
&nbsp;&nbsp;&nbsp;<strong>ByVal </strong><i><a class="parameter" id="RecordTo" href="#" onclick="javascript:showParamBox();">RecordTo</a></i></strong> <strong>As</strong> <b>Long</b>, _
&nbsp;&nbsp;&nbsp;<strong>ByVal </strong><i><a class="parameter" id="ColumnFrom" href="#" onclick="javascript:showParamBox();">ColumnFrom</a></i></strong> <strong>As</strong> <b>Long</b>, _
&nbsp;&nbsp;&nbsp;<strong>ByVal </strong><i><a class="parameter" id="ColumnTo" href="#" onclick="javascript:showParamBox();">ColumnTo</a></i></strong> <strong>As</strong> <b>Long</b> _
)<strong> </strong></PRE></p></div><!--DXMETADATA end --> 
            <!--DXMETADATA start type="FilteredItemList" scrap="PARAMETERS_LIST" namespace="parameter" source="Item" filter="" format="<h4 class=dxh4>$$ParameterList$$</h4>%%filtereditemlist%%" --><h4 class=dxh4>Parameters</h4><DL>
<DT><I>RecordFrom</I></DT>
<DD>Index of the record to start the merge.&nbsp; Will be the same as <STRONG>RecordTo</STRONG> if merging cells horizontally.</DD>
<DT><I>RecordTo</I></DT>
<DD>Index of the record to&nbsp;end the merge. Will be the same as <STRONG>RecordFrom</STRONG> if merging cells horizontally.</DD>
<DT><I>ColumnFrom</I></DT>
<DD>Index of the&nbsp;column to start the merge.&nbsp; Will be the same as <STRONG>ColumnTo</STRONG> if merging cells vertically.</DD>
<DT><I>ColumnTo</I></DT>
<DD>Index of the&nbsp;column to&nbsp;end the merge. Will be the same as <STRONG>ColumnFrom</STRONG> if merging cells vertically.</DD>
</DL><!--DXMETADATA end --> 
            <!--DXMETADATA start type="TaggedComment" source="Item" id="##RETURNS" format="<h4 class=dxh4>$$Return_Type$$</h4><p>%%comment%%</p>" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="TaggedComment" source="Item" id="##REMARKS" format="<h4 class=dxh4>$$Remarks$$</h4><p>%%comment%%</p>" --><h4 class=dxh4>Remarks</h4><p><P><STRONG>MergeItems</STRONG> allows cells in the report to be merged both vertically and horizontally.&nbsp; </P>
<P>&nbsp;</P>
<P>Important&nbsp;information about merging:</P>
<P>-Merged cells supports sorting and reordering.</P>
<P>-When merging, ONLY the data in the first merged cell is used.&nbsp; </P>
<P>-If a column is moved&nbsp;that contains a merged cell then that merged cell will also display the same data that is displayed in the first merged cell.</P>
<P>-To clear all the merged cells call MergeItems(Null, Null, Null, Null)</P>
<P>-Merged cells use the record index NOT the row index.</P>
<P>&nbsp;</P>
<P><IMG border=0 src="Pictures/mergedvertically.png"></P>
<P><IMG border=0 src="Pictures/mergedvertically1.png"></P></p><!--DXMETADATA end --> 
            <!--DXMETADATA start type="sourcecode" format="<h4 class=dxh4>$$Source_Code$$</h4><table border=0 cellpadding=0 cellspacing=0 class=sourcecode><tr><td nowrap>%%sourcecode%%</td></tr></table>" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="TaggedComment" source="Item" id="##EXAMPLEINTRO" format="<h4 class=dxh4>$$Example$$</h4><p>%%comment%%</p>" --><h4 class=dxh4>Example</h4><p><P>Option Explicit</P>
<P>' Constants used to identify columns, this will be the column ItemIndex<BR>Const COLUMN_SURVEY = 0<BR>Const COLUMN_VS6 = 1<BR>Const COLUMN_VS2005 = 2<BR>Const COLUMN_VS2008 = 3<BR>Const COLUMN_VS2010 = 4</P>
<P>Private Sub Form_Load()</P>
<P>&nbsp;&nbsp;&nbsp; Dim Column As ReportColumn<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; Set Column = wndReportControl.Columns.Add(COLUMN_SURVEY, "A", 200, True)<BR>&nbsp;&nbsp;&nbsp; Column.Alignment = xtpAlignmentWordBreak<BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; Set Column = wndReportControl.Columns.Add(COLUMN_VS6, "B", 100, True)<BR>&nbsp;&nbsp;&nbsp; Set Column = wndReportControl.Columns.Add(COLUMN_VS2005, "C", 100, True)<BR>&nbsp;&nbsp;&nbsp; Set Column = wndReportControl.Columns.Add(COLUMN_VS2008, "D", 100, True)<BR>&nbsp;&nbsp;&nbsp; Set Column = wndReportControl.Columns.Add(COLUMN_VS2010, "E", 100, True)<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; AddData "Visual Studio Survey", "Version", "1", "2", "3"<BR>&nbsp;&nbsp;&nbsp; AddData "Number of Users", "VS 6", "VS 2005", "VS 2008", "VS 2010"<BR>&nbsp;&nbsp;&nbsp; AddData "", "50", "25", "70", "150"<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; wndReportControl.Records.MergeItems 0, 0, COLUMN_VS6, COLUMN_VS2010<BR>&nbsp;&nbsp;&nbsp; wndReportControl.Records.MergeItems 1, 2, COLUMN_SURVEY, COLUMN_SURVEY<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; ' Set other ReportControl options<BR>&nbsp;&nbsp;&nbsp; wndReportControl.PaintManager.VerticalGridStyle = xtpGridSolid<BR>&nbsp;&nbsp;&nbsp; wndReportControl.PaintManager.HorizontalGridStyle = xtpGridSolid<BR>&nbsp;&nbsp;&nbsp; wndReportControl.AllowEdit = False<BR>&nbsp;&nbsp;&nbsp; wndReportControl.FocusSubItems = True<BR>&nbsp;&nbsp;&nbsp; wndReportControl.AllowColumnRemove = False<BR>&nbsp;&nbsp;&nbsp; wndReportControl.PaintManager.FixedRowHeight = False<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; wndReportControl.PaintManager.DrawGridForEmptySpace = True<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; wndReportControl.FocusSubItems = False<BR>&nbsp;&nbsp;&nbsp; wndReportControl.ShowRowFocus = False<BR>&nbsp;&nbsp;&nbsp; wndReportControl.PaintManager.HighlightForeColor = vbBlack<BR>&nbsp;&nbsp;&nbsp; wndReportControl.PaintManager.HighlightBackColor = vbWhite<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </P>
<P>&nbsp;&nbsp;&nbsp; ' Apply changes<BR>&nbsp;&nbsp;&nbsp; wndReportControl.Populate</P>
<P>End Sub</P>
<P>Private Sub Form_Resize()<BR>&nbsp;&nbsp;&nbsp; ' Resize ReportControl if a form is resized by user<BR>&nbsp;&nbsp;&nbsp; On Error Resume Next<BR>&nbsp;&nbsp;&nbsp; wndReportControl.Move 0, 0, ScaleWidth, ScaleHeight<BR>End Sub</P>
<P>Private Sub mnuClose_Click()<BR>&nbsp;&nbsp;&nbsp; ' Close form and unload it's contests<BR>&nbsp;&nbsp;&nbsp; Unload Me<BR>End Sub</P>
<P>Sub AddData(survey As Variant, vs6 As Variant, vs2005 As Variant, vs2008 As Variant, vs2010 As Variant)<BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; Dim Record As ReportRecord<BR>&nbsp;&nbsp;&nbsp; Dim Item As ReportRecordItem<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; Set Record = wndReportControl.Records.Add<BR>&nbsp;&nbsp;&nbsp; Set Item = Record.AddItem(survey)<BR>&nbsp;&nbsp;&nbsp; Item.Alignment = xtpAlignmentCenter<BR>&nbsp;&nbsp;&nbsp; Set Item = Record.AddItem(vs6)<BR>&nbsp;&nbsp;&nbsp; Item.Alignment = xtpAlignmentCenter<BR>&nbsp;&nbsp;&nbsp; Set Item = Record.AddItem(vs2005)<BR>&nbsp;&nbsp;&nbsp; Item.Alignment = xtpAlignmentCenter<BR>&nbsp;&nbsp;&nbsp; Set Item = Record.AddItem(vs2008)<BR>&nbsp;&nbsp;&nbsp; Item.Alignment = xtpAlignmentCenter<BR>&nbsp;&nbsp;&nbsp; Set Item = Record.AddItem(vs2010)<BR>&nbsp;&nbsp;&nbsp; Item.Alignment = xtpAlignmentCenter<BR>&nbsp;&nbsp;&nbsp; <BR>End Sub</P></p><!--DXMETADATA end --> 
            <!--DXMETADATA start type="FilteredItemList" scrap="INLINE_EXAMPLE" namespace="Example" source="Item" filter="type=inline" NoHeader="True" NoFooter="True" format="<h4 class=dxh4>$$Example$$</h4>,format= %%%%filtereditemlist%%" --><!--DXMETADATA end --> 
            <!--DXMETADATA start type="FilteredItemList" scrap="MENU_LINK" namespace="seealso" source="Item" filter="" NoHeader="True" NoFooter="True" format="<h4 class=dxh4>$$See_Also$$</h4><p id=dxseealsocontent>%%filtereditemlist%%</p>" --><h4 class=dxh4>See Also</h4><p id=dxseealsocontent><a href="#Bookmark14113">ReportRecords Collection</a>
</p><!--DXMETADATA end --><!--DXMETADATA start type="FilteredItemList" scrap="MENU_LINK" namespace="example" source="Item" filter="type=linked" NoHeader="True" NoFooter="True" format="><!--DXMETADATA end --><!--DXMETADATA start type="Variable" name="CopyrightNotice" format="><!--DXMETADATA end --></div></div>	
	<div id="winchm_template_footer">Copyright &copy; 2018. All rights 
reserved. (To change the copyright info, just edit it in template.)</div>
</div>

</body>
</html>

